// components/nav-bar/nav-bar.js
const app = getApp()
Component({
  properties: {
    title: {
      type: null,
      value: ''
    },
    backShopping: {
      type: Boolean,
      value: false
    },
    backText: {
      type: null,
      value: ''
    },
    transparent: {
      type: Boolean,
      value: false
    },
    backColor: {
      type: String,
      value: '#fff'
    },
    isIPhoneX: {
      type: Boolean,
      value: false
    }
  },

  ready () {
    this.setData({
      isIPhoneX: app.globalData.isIPhoneX
    })
    console.log(app.globalData.isIPhoneX)
  },

  options:{
    multipleSlots: true
  },

  methods: {
    back () {
      if (!this.properties.backShopping) {
        wx.navigateBack({
          delta: 1
        })
      } else {
        wx.navigateToMiniProgram({
          appId: 'wxfe951dcab1dc4b81'
        })
      }
    }
  }
})